import Layout from '@/layout'
// 静态路由
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: { title: '首页', icon: 'dashboard' }
    }]
  }
]
// 动态路由
export const dynamicRoutes = [
  {
    path: '/product',
    name: 'Product',
    component: Layout,
    meta: { title: '商品管理', icon: 'el-icon-menu' },
    children: [
      {
        path: 'category/list',
        name: 'Category',
        component: () => import('@/views/product/category'),
        meta: { title: '分类管理' }
      },
      {
        path: 'trademark/list',
        name: 'Trademark',
        component: () => import('@/views/product/trademark'),
        meta: { title: '品牌管理' }
      },
      {
        path: 'attr/list',
        name: 'Attr',
        component: () => import('@/views/product/attr'),
        meta: { title: '属性管理' }
      },
      {
        path: 'spu/list',
        name: 'Spu',
        component: () => import('@/views/product/spu'),
        meta: { title: 'SPU管理' }
      },
      {
        path: 'sku/list',
        name: 'Sku',
        component: () => import('@/views/product/sku'),
        meta: { title: 'SKU管理' }
      }
    ]
  },

  {
    path: '/acl',
    name: 'Acl',
    component: Layout,
    meta: { title: '权限管理', icon: 'el-icon-key' },
    children: [
      {
        path: 'user/list',
        name: 'User',
        component: () => import('@/views/acl/user/index.vue'),
        meta: { title: '用户管理' }
      },
      {
        path: 'role/list',
        name: 'Role',
        component: () => import('@/views/acl/role/index.vue'),
        meta: { title: '角色管理' }
      },
      {
        path: 'role/auth',
        name: 'RoleAuth',
        component: () => import('@/views/acl/auth/index.vue'),
        hidden: true
      },
      {
        path: 'permission/list',
        name: 'Permission',
        component: () => import('@/views/acl/permission/index.vue'),
        meta: { title: '菜单管理' }
      }
    ]
  }
]
// 404
export const errorRoute = [
  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true }
]

